package com.alxbrendmaquinarias.repository;

import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;
import org.hibernate.jpa.HibernateEntityManager;

public interface GenericDAO {

    public <T> T create(T t);

    public <T> T find(Class<T> type, Object id);

    public <T> void delete(T t);

    public <T> T update(T t);
    
    public void update(String sql, boolean isNative);

    public List findWithNamedQuery(String queryName);

    public List findWithNamedQuery(String queryName, int resultLimit);

    public List findWithNamedQuery(String namedQueryName,
            Map<String, Object> parameters);

    public List findWithNamedQuery(String namedQueryName,
            Map<String, Object> parameters,
            int resultLimit);

    public <T> List<T> findWithNativeQuery(String sql, Class<T> type);
    
    public Object count(String queryName, Map<String, Object> parameters);
    public Object countQuery(String query, Map<String, Object> parameters);
    
    public List findWithNamedQueryLazyLoading(String queryName, Map<String, Object> parameters, int start, int finish);
    
    public Object getByIdLazy(Class clazz, Integer id);
    
    public List findWithQuery(String query, Map<String, Object> parameters);

}
